<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文件分享</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0;
            padding: 20px;
        }
        
        .share-container {
            background: white;
            border-radius: 20px;
            padding: 40px;
            max-width: 500px;
            width: 100%;
            text-align: center;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        }
        
        .share-container h1 {
            color: #333;
            margin-bottom: 30px;
        }
        
        .file-preview {
            width: 100%;
            max-width: 300px;
            height: 200px;
            object-fit: cover;
            border-radius: 10px;
            margin: 20px auto;
            display: block;
        }
        
        .file-icon {
            width: 100%;
            max-width: 300px;
            height: 200px;
            background: #f8f9fa;
            border-radius: 10px;
            margin: 20px auto;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 64px;
        }
        
        .file-name {
            font-size: 18px;
            font-weight: 600;
            color: #333;
            margin-bottom: 10px;
            word-break: break-all;
        }
        
        .file-size {
            color: #666;
            margin-bottom: 20px;
        }
        
        .download-btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 10px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s ease;
            text-decoration: none;
            display: inline-block;
        }
        
        .download-btn:hover {
            transform: translateY(-2px);
        }
        
        .share-info {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 10px;
            margin: 20px 0;
            font-size: 14px;
            color: #666;
        }
    </style>
</head>
<body>
    <div class="share-container">
        <h1>📁 文件分享</h1>
        
        <div th:if="${file.image}">
            <img th:src="'/albums/' + ${file.fileName}" th:alt="${file.originalName}" class="file-preview">
        </div>
        <div th:if="${!file.image}" class="file-icon">
            📄
        </div>
        
        <div class="file-name" th:text="${file.originalName}"></div>
        <div class="file-size" th:text="${file.size + ' bytes'}"></div>
        
        <div class="share-info">
            <p>此文件通过安全链接分享，请注意保护隐私</p>
            <p style="display: none;">链接有效期为30分钟，下载次数有限制</p>
        </div>
        
        <a th:href="'/share/download/' + ${token}" class="download-btn">下载文件</a>
    </div>
</body>
</html>